package com.alpesressources.comexpert.util;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import com.alpesressources.comexpert.bo.response.ErrorResponse.EnumErrorCode;

public class EnumErrorCodeAdapter extends XmlAdapter<Integer, EnumErrorCode> {

	@Override
	public Integer marshal(EnumErrorCode v) throws Exception {
		Integer ret = null;
		try {
			ret = v.getCode();
		} catch (Exception e) {
		}
		return ret;
	}

	@Override
	public EnumErrorCode unmarshal(Integer v) throws Exception {
		return EnumErrorCode.fromInteger(v);
	}

}
